package com.gaoshu.controller;

import com.gaoshu.bean.Departments;
import com.gaoshu.bean.Doctor;
import com.gaoshu.bean.Registeredtype;
import com.gaoshu.service.DoctorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
//关于医生列表
@Controller
@RequestMapping("/doctorController")
public class DoctorController {

    @Autowired
    private DoctorService doctorService;


    //动态查询医生列表
    @RequestMapping("/selectDoctor.do")
    public String selectDoctor(Doctor doctor, Model model){
      List<Doctor> list= doctorService.selectDoctor(doctor);
      model.addAttribute("list",list);
      System.out.println("123");
      return "";
    }

    //修改医生信息  回显科室
    @RequestMapping("/selectDepartments.do")
    @ResponseBody
    public List<Departments> selectDepartments(){
        List<Departments> list=doctorService.selectDepartments();
        return list;
    }


    //修改医生信息  回显挂号类别
    @RequestMapping("/selectRegisteredtype.do")
    @ResponseBody
    public List<Registeredtype> selectRegisteredtype(){
        List<Registeredtype> list=doctorService.selectRegisteredtype();
        return list;
    }

}
